package com.nariano.webapp;

import org.apache.wicket.Application;
import org.apache.wicket.Request;
import org.apache.wicket.Session;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.protocol.http.WebSession;

import com.nariano.server.domain.entities.User;

public class NarianoSession extends WebSession {
    
    private User user;

    public NarianoSession(Request request) {
        super(request);
    }

    public NarianoSession(Application application, Request request) {
        super(application, request);
    }

    public NarianoSession(WebApplication application, Request request) {
        super(application, request);
    }
    
    public static NarianoSession get() {
        return (NarianoSession) Session.get();
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
    
    public boolean isAuthenticied() {
        return user!=null && user.getId()!=null;
    }
    
    
    
}
